<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.thymeleaf.org/thymeleaf-extras-shiro">
<head>
    <meta charset="UTF-8">
    <title>学员信息列表</title>
    <link rel="icon" th:href="@{/favicon.ico}">
    <link rel="shortcut icon" th:href="@{/favicon.ico}">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <link type="text/css"  th:href="@{/css/index.css}" rel="stylesheet"  />
    <link type="text/css"  th:href="@{/css/jconfirm.css}" rel="stylesheet"  />
    <script th:src="@{/js/jQuery1.7.2.js}" type="text/javascript"></script>
    <script th:src="@{/js/index.js}" type="text/javascript"></script>
    <script th:src="@{/js/jconfirm.js}" type="text/javascript"></script>
</head>
<body>
    <div class="mian_center">
        <span class="main_titile"><img th:src="@{/images/login_j_03.png}">学员信息查询</span>

        <div class="main_con">
            <form id="searchFr" th:action="@{/stu/list}" method="get">
                <ul>
                    <li><span>学员姓名:</span>
                        <input name="stuName" type="text" th:value="*{param.stuName}" placeholder="请输入学员姓名" autocomplete="off" />
                    </li>
                    <li><span>居住地址:</span>
                        <input name="stuAddress" type="text" th:value="*{param.stuAddress}" placeholder="请输入学员居住地址" autocomplete="off" />
                    </li>
                    <li><span>性&nbsp;别:</span>
                        <select name="stuSex">
                            <option value="">【请选择】</option>
                            <option th:selected="*{param!=null && #strings.equals(param.stuSex,'1')}" value="1">男</option>
                            <option th:selected="*{param!=null && #strings.equals(param.stuSex,'2')}" value="2">女</option>
                        </select>
                    </li>
                    <li><span>是否缴费:</span>
                        <select name="isPayment">
                            <option value="">【请选择】</option>
                            <option th:selected="*{param!=null && #strings.equals(param.isPayment,'2')}" value="2">是</option>
                            <option th:selected="*{param!=null && #strings.equals(param.isPayment,'1')}" value="1">否</option>
                        </select>
                    </li>
                    <li><span>所选课程:</span>
                        <select name="courseName">
                            <option value="">【请选择】</option>
                            <option th:if="${courses != null}" th:each="course : ${courses}"
                                    th:selected="*{param!=null && #strings.equals(param.courseName,course.courseId)}"
                                    th:value="${course.courseId}">[[${course.courseName}]]</option>
                        </select>
                    </li>
                    <li shiro:hasPermission="user:list"><span>状态:</span>
                        <select name="flag">
                            <option value="">【请选择】</option>
                            <option th:selected="*{param!=null && #strings.equals(param.flag,'1')}"
                                    th:value="1">已删除</option>
                            <option th:selected="*{param!=null && #strings.equals(param.flag,'0')}"
                                    th:value="0">未删除</option>
                        </select>
                    </li>
                    <li>
                        <span>年龄范围:</span>
                        <select name="minAge">
                            <option value="">【请选择】</option>
                            <option th:each="num : ${#numbers.sequence(6,16)}" th:selected="*{#strings.equals(param.minAge,num)}" th:value="${num}">[[${num}]]</option>
                        </select>
                        &nbsp;-&nbsp;
                        <select name="maxAge">
                            <option value="">【请选择】</option>
                            <option th:each="num : ${#numbers.sequence(6,16)}" th:selected="*{#strings.equals(param.maxAge,num)}" th:value="${num}">[[${num}]]</option>
                        </select>
                    </li>
                    <li><span class="msg">[[${msg}]]</span></li>
                </ul>
                <span class="main_button">
                    <input  id="pSize"  name="pSize" type="hidden" th:value="*{param.pSize}" />
                    <input  id="currentPn"  name="pn" type="hidden" th:value="*{param.pn}" />
                    <input type="submit" value="查询" />
                </span>
            </form>

            <table>
                <tr>
                    <th width="30"><input type="checkbox" id="selectAll"></th>
                    <th width="50">序号</th>
                    <th>学员姓名</th>
                    <th>监护人姓名</th>
                    <th>监护人关系</th>
                    <th>监护人电话</th>
                    <th>学员性别</th>
                    <th>学员年龄</th>
                    <th>居住地址</th>
                    <th>所选课程</th>
                    <th>是否缴费</th>
                    <th>学员备注</th>
                    <th shiro:hasPermission="user:list">创建时间</th>
                    <th shiro:hasPermission="user:list">修改时间</th>
                    <th>操作</th>
                </tr>

                    <tr th:each="stu : ${stus}">
                        <td><input type="checkbox" class="selectItem" th:value="${stu.stuId}"></td>
                        <td>[[${stu.stuId }]]</td>
                        <td>[[${stu.stuName }]]</td>
                        <td>[[${stu.stuParentName }]]</td>
                        <td>[[${stu.stuParentRelation }]]</td>
                        <td>[[${stu.stuParentPhone }]]</td>
                        <td>[[${stu.stuSex==1?'男':'女' }]]</td>
                        <td>[[${stu.stuAge }]]</td>
                        <td>[[${stu.stuAddress }]]</td>
                        <td>[[${stu.courseName }]]</td>
                        <td>[[${stu.payerId==1?'是':'否' }]]</td>
                        <td>[[${stu.remark==null?'--':stu.remark }]]</td>
                        <td shiro:hasPermission="user:list">[[${stu.createTime==null?'--':#dates.format(stu.createTime,'YYYY/MM/dd HH:mm:ss')}]]</td>
                        <td shiro:hasPermission="user:list">[[${stu.updateTime==null?'--':#dates.format(stu.updateTime,'YYYY/MM/dd HH:mm:ss')}]]</td>
                        <td>
                            <a shiro:hasPermissions="[stu:list,stu:add]" class="btn mr5" th:href="@{/stu/edit(stuId=${stu.stuId })}" title="修改">修改</a>
                            <a shiro:hasPermissions="[stu:list,stu:add]" th:if="${#strings.equals(stu.flag,'0')}" class="btn" th:href="${'javascript: remove('+stu.stuId+');'}" title="删除">删除</a>
                            <a shiro:hasPermission="user:list" th:if="${#strings.equals(stu.flag,'1')}" class="btn" th:href="${'javascript: remove('+stu.stuId+');'}" title="删除">删除</a>
                        </td>
                    </tr>
                    <tr th:if="${#lists.isEmpty(stus)}">
                        <td colspan="15">暂无任何记录</td>
                    </tr>

            </table>
        </div>

        <div class="main_page_number"
             th:unless="${#lists.isEmpty(stus)}" th:include="/common/page :: page">
        </div>
    </div>
</body>
</html>